package edu.chen.controller;

import edu.chen.entity.User;
import edu.chen.exception.lease.NotFountException;
import edu.chen.exception.login.NoUserException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class TestController {
    @RequestMapping("noUser")
    private void test(){
        throw new NoUserException();
    }

    @RequestMapping("notFound")
    private void test2(){
        throw new NotFountException();
    }


    @ModelAttribute
    public User user(){
        return new User("chen","19951217");
    }


    @RequestMapping(value = "test")
    @ModelAttribute("testAttribute")
    private String test1(){
        return "hi";
    }

}
